﻿using System;
using UnityEngine;
using UnityEngine.AddressableAssets;

namespace HotFixPro
{
    public static class StartGame
    {
        public static void SetupGame()
        {
            //防止Task内的报错找不到堆栈，不建议删下面的代码
            System.Threading.Tasks.TaskScheduler.UnobservedTaskException += (sender, e) =>
            {
                foreach (var innerEx in e.Exception.InnerExceptions)
                {
                    Debug.LogError($"{innerEx.Message}\n" +
                                   $"ILRuntime StackTrace: {innerEx.Data["StackTrace"]}\n\n" +
                                   $"Full Stacktrace: {innerEx.StackTrace}");
                }
            };
        }
        public static void RunGame()
        {
            Addressables.InitializeAsync(false);
            //正式开始
            UIMgr.Instance.OpenPanelAsync("Login");
        }
    }
}
